# Replication Package for: Measuring Global Migration Flows using Online Data

This replication package accompanies Chi, G., Abel G., Johnston D., Giraudy E., Bailey M. "Measuring Global Migration Flows using Online Data". PNAS.

## Authors

- Guanghua Chi
- Guy Abel
- Drew Johnston
- Eugenia Giraudy
- Mike Bailey

## Data

### Global migration flows
We release the migration estimates publicly through the Humanitarian Data Exchange (https://data.humdata.org/dataset/international-migration-flows).

### External datasets
The paper uses several external datasets to estimate migration flows, validate the estiamtes, and analyze the migration flows.
- Our World in Data COVID-19 dataset: https://github.com/owid/covid-19-data/blob/master/public/data/owid-covid-data.csv
- Wold population data: https://data.worldbank.org/indicator/SP.POP.TOTL
- Migration data in New Zealand: https://www.stats.govt.nz/information-releases/international-migration-december-2023/
- Migration data in Eurostat: https://ec.europa.eu/eurostat/databrowser/product/view/migr_imm5prv?lang=en&category=migr.migr_cit.migr_immi

## Computational Requirements

* Python 3.12.7
    * pandas 2.2.2
    * numpy 1.26.4
    * scipy 1.13.1
    * matplotlib 3.9.2
    * adjustText 1.3.0

* R 4.4.1
    * tidyverse 2.0.0
    * migest 2.0.4

## Description of code

| Figure | Name | Script |
| -------| -----| -------|
| Fig. 1 | Global international migration over time | fig1.py|
| Fig. 2 | Estimated international migration flows in 2022, in millions of people. | fig2a_data.py|
|  | Note: Run fig2a_data.py before this step | fig2a.R|
|  | | fig2bcde.py|
| Fig. 3 | Migration Flows and COVID-19 policy stringency| fig3.py|
| Fig. 4 | Reported country-to-country migration flows vs. Facebook estimates in thousands| fig4.py|
